# def func(*args,**kwargs):
#     print(args,kwargs)
# func(12,3,*[11,22])

# def func(arg):
#     return arg.pop(1)
#
# result = func([11,22,33,44])
# print(result)

# func_list = []
#
# for i in range(10):
#     func_list.append(lambda :i)
#
# v1 = func_list[0]()
# v2 = func_list
# print(v1,v2)

# func_list = []
#
# for i in range(10):
#     func_list.append(lambda x:x+i)
#
# v1 = func_list[0](2)
# v2 = func_list[5](1)
# print(v1,v2)
#
# func_list = []
#
# for i in range(10):
#     func_list.append(lambda x:x+i)
#
# for i in range(0,len(func_list)):
#     result = func_list[i](i)
#     print(result)

# def f1():
#     print('f1')
#
# def f2():
#     print('f2')
#     return f1
#
# func = f2()
# result = func()
# print(result)

# def f1():
#     print('f1')
#     return f3()
#
# def f2():
#     print('f2')
#     return f1
#
# def f3():
#     print('f3')
#
# func = f2()
# result = func()
# print(result)
#
# name = '景女神'
# def func():
#     def inner():
#         print(name)
#     return inner()
#
# v = func()
# print(v)
#
# name = '景女神'
#
# def func():
#     def inner():
#         print(name)
#         return "老男孩"
#     return inner()
#
# v = func()
# print(v)

# name = '景女神'
#
# def func():
#     def inner():
#         print(name)
#         return '老男孩'
#     return inner
#
# v = func()
# result = v()
# print(result)

# def func():
#     name = '666'
#     def inner():
#         print(name)
#         return '777'
#     return inner
#
# v1 = func()
# v2 = func()
# print(v1,v2)

# def func(name):
#     def inner():
#         print(name)
#         return '老男孩'
#     return inner
#
# v1 = func('金老板')
# v2 = func('alex')
# print(v1,v2)

# def func(name=None):
#     if not name:
#         name= '武沛齐'
#     def inner():
#         print(name)
#         return '老男孩'
#     return inner
#
# v1 = func()
# v2 = func('alex')
# print(v1,v2)

# def func(name):
#     v = lambda x:x+name
#     return v
#
# v1 = func('武沛齐')
# v2 = func('alex')
# v3 = v1('银角')
# v4 = v2('金角')
# print(v1,v2,v3,v4)

# NUM = 100
# result = []
# for i in range(10):
#     func = lambda : NUM      # 注意：函数不执行，内部代码不会执行。
#     result.append(func)
#
# print(i)
# print(result)
# v1 = result[0]()
# v2 = result[9]()
# print(v1,v2)

# result = []
# for i in range(10):
#     func = lambda : i      # 注意：函数不执行，内部代码不会执行。
#     result.append(func)
#
# print(i)
# print(result)
# v1 = result[0]()
# v2 = result[9]()
# print(v1,v2)

# def func(num):
#     def inner():
#         print(num)
#
#     return inner
#
# result = []
# for i in range(10):
#     f = func(i)
#     result.append(f)
#
# print(i)
# print(result)
# v1 = result[0]()
# v2 = result[9]()
# print(v1,v2)